import React from 'react';
import { AppRegistry } from 'react-native';
import dva from 'dva/mobile';
import { createLogger } from 'redux-logger';
import Router from './router';
import { registerModels } from './models';

const app = dva({
  initialState: {},
  onAction: [
    createLogger(),
  ],
  extraEnhancers: [
    // autoRehydrate(),
  ],
  onError(e) {
    console.warn('onError', e);
  },
});

registerModels(app);

app.router(() => <Router />);

const App = app.start();

AppRegistry.registerComponent('dod', () => App);
